<extend name="Base/common"/>
<block name="style">
    <!--<link href="__CSS__/event.css" rel="stylesheet" type="text/css"/>-->
</block>
<block name="body">
	<style>
		.event_header_title a,.hd-list a{
			font-size: 1.6rem !important;
		}
		.sidebar-title-r{
			line-height: 2 !important;
		}
	</style>
<!--导航-->
<!--大banner图-->
	<div class="m-banner am-cf"><img src="__PUBLIC__/images/banner1.jpg"></div>
<!--大banner图-->
<div class="container  index-news con-color am-cf index-project-mp index-project">
    <!--搜索等-->
    <!--搜索等-->
   	<!--副标题-->
    <div class="path am-padding-1-sm am-padding-horizontal-md am-padding-horizontal-lg am-margin-bottom am-cf">
        <div class="subtitle  am-u-sm-12 am-u-md-6 am-u-lg-6 am-padding-0-sm">
            <strong>V</strong>
            <h3>志愿者<span>管理中心</span></h3>
            <p>
                志/愿/青/春&nbsp;爱/我/寿/光<br/>
                OLUNTEER PROJECT
            </p>
        </div>
       <include file="Public/detail_login"/>
       
    </div>
    <!--副标题-->
 <div class="am-cf news-detail  am-padding-0">
	<include file="Public/base"/>
    <div class="content am-u-sm-12 am-u-md-9 am-u-lg-9">
		<form name="" action="" method="post" class="am-cf search-form am-padding-1-sm" style="background-color: #f8f8f8;">
			<div class="sidebar-title-r">
	            <label>组织名称</label>
	            <input type="text" name="key"/>
	            <input type="submit" value="查询"/>	            
			</div>
        </form>
			
		<div class="clearfix event_header_title">           
            <div class="col-xs-12 col-sm-5 btn-group btn-group-sm  pull-right" style="margin-bottom:5px;margin-top:10px;padding:0">
            	<if condition="$is_exsit eq 1">
					<a class="col-xs-4 btn btn-default" href="{:U('Event/Index/add')}">发起活动</a>
				</if>
                <a href="{:U('myevent',array('lora'=>'','type_id'=>$type_id))}"
                   class="col-xs-4 btn btn-default <if condition="$lora
                   eq ''">active</if>">{:L('_MY_SPONSOR_')}</a>
                <a href="{:U('myevent',array('lora'=>'attend','type_id'=>$type_id))}"
                   class="col-xs-4 btn btn-default <if condition="$lora eq 'attend'">active</if>">{:L('_MY_IN_')}</a>
               
            </div>
        </div>
      
           <!--组织列表-->
        <table class="am-table am-table-bordered am-margin-top-md am-margin-top-lg  am-text-center am-hide-sm-only">
            <tr>
                <td>组织名称</td>
                <!--<td>活动类型</td>-->
                <td>参与人数</td>
                <td>活动状态</td>
                <td>活动时间</td>
                <td>操作</td>
            </tr>
            <volist name="contents" id="vo">
	            <tr>
	                <td><a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}">{$vo.title}</a></td>
	                <!--<td> {$vo.type.title}</td>-->
	                <td>{$vo.signCount}</td>
	                <td>
	                	<if condition="time() lt $vo['deadline'] ">                        
                        	招募中
                        <elseif condition="time() lt $vo['eTime']"/>
                        	{:L('_IN_PROGRESS_')}
                        <else/>
                            {:L('_ALREADY_OVER_')}
                    	</if>
	                </td>
	                <td>{:date('Y-m-d',$vo['sTime'])}--{:date('Y-m-d',$vo['eTime'])}</td>
	                <td class="op-btn">
                    	<if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">
                            <if condition="time() lt $vo['eTime']">
                                <a class="btn btn-default endEvent" data-eventID="{$vo.id}">{:L('_OVER_AHEAD_')}</a>
                            </if>

                            <a href="{:U('edit',array('id'=>$vo['id']))}" class="btn btn-default">{:L('_EVENT_EDIT_')}</a>
                            <a class="btn btn-default delEvent" data-eventID="{$vo.id}">{:L('_EVENT_DELETE_')}</a>
                        </if>
                        <if condition="($vo['uid'] neq is_login())">
                            <php>if(!$vo['check_isSign']){</php>

                            <php>if($vo['deadline'] < time()){</php>
                            <a class="btn btn-default  " href="javascript:"
                               onclick="toast.error({:L('')})">{:L('_REGISTRATION_HAS_OVER_')} </a>
                            <php>}else{</php>
                            <if condition="is_login() eq 0">
                                <a class="btn btn-info  " href="javascript:" style="color: #fff"
                                   onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">{:L('_REGISTER_OP_')} </a>
                                <else/>
                                <if condition="check_auth('Event/Index/doSign')">
                                    <a class="btn btn-primary event_sign " style="color: #fff"
                                       href="{:U('ajax_sign',array('event_id'=>$vo['id']))}">{:L('_REGISTER_OP_')} </a></if>
                            </if>
                            <php>}</php>
                            <php>}else{</php>
                            &nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-default unSign"
                                                       data-eventID="{$vo.id}" href="javascript:"
                                                       id="unSign">{:L('_REGISTER_CANCEL_')} </a>

                            <span style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;&nbsp;&nbsp;<if
                                    condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
                                <else/>
                                {:L('_AUDIT_OP_')}
                            </if></span>

                            <php>}</php>

                        </if>
	                </td>  
	            </tr>
 			</volist>
        </table>
         <ul class="hd-list am-text-center am-show-sm-only am-padding-0">
            <volist name="contents" id="vo">                    
	            <li class="am-cf am-padding-vertical-sm">              
	                <div class="am-u-sm-12 am-text-left">{$vo.title}</div>
	                <div class="am-u-sm-4 am-text-left">类别：{$vo.type.title}</div>
	                <div class="am-u-sm-4">{$vo.signCount}个人报名</div>
	                <div class="am-u-sm-4 am-text-right">
	                	<if condition="time() lt $vo['deadline'] ">                        
                        	招募中
                        <elseif condition="time() lt $vo['eTime']"/>
                        	{:L('_IN_PROGRESS_')}
                        <else/>
                            {:L('_ALREADY_OVER_')}
                    	</if>
	                </div>
	                <div class="am-u-sm-12 am-text-left">活动时间：{:date('Y-m-d',$vo['sTime'])}--{:date('Y-m-d',$vo['eTime'])}</div>
	                <div class="am-u-sm-12 op-btn am-text-right">
	                    <if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">
                            <if condition="time() lt $vo['eTime']">
                                <a class="btn btn-default endEvent" data-eventID="{$vo.id}">{:L('_OVER_AHEAD_')}</a>
                            </if>

                            <a href="{:U('edit',array('id'=>$vo['id']))}" class="btn btn-default">{:L('_EVENT_EDIT_')}</a>
                            <a class="btn btn-default delEvent" data-eventID="{$vo.id}">{:L('_EVENT_DELETE_')}</a>
                        </if>
                        <if condition="($vo['uid'] neq is_login())">
                            <php>if(!$vo['check_isSign']){</php>

                            <php>if($vo['deadline'] < time()){</php>
                            <a class="btn btn-default  " href="javascript:"
                               onclick="toast.error({:L('')})">{:L('_REGISTRATION_HAS_OVER_')} </a>
                            <php>}else{</php>
                            <if condition="is_login() eq 0">
                                <a class="btn btn-info  " href="javascript:" style="color: #fff"
                                   onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">{:L('_REGISTER_OP_')} </a>
                                <else/>
                                <if condition="check_auth('Event/Index/doSign')">
                                    <a class="btn btn-primary event_sign " style="color: #fff"
                                       href="{:U('ajax_sign',array('event_id'=>$vo['id']))}">{:L('_REGISTER_OP_')} </a></if>
                            </if>
                            <php>}</php>
                            <php>}else{</php>
                            &nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-default unSign"
                                                       data-eventID="{$vo.id}" href="javascript:"
                                                       id="unSign">{:L('_REGISTER_CANCEL_')} </a>

                            <span style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;&nbsp;&nbsp;<if
                                    condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
                                <else/>
                                {:L('_AUDIT_OP_')}
                            </if></span>

                            <php>}</php>

                        </if>
	                </div>  
	            </li>
         	</volist>
        </ul>
        <!--组织列表-->
        <div class="row issue_list">
            <if condition="count($contents) eq 0">
                <div style="font-size:3em;padding:2em 0;color: #ccc;text-align: center">{:L('_TIP_EMPTY_')}</div>
            </if>
        </div>
    </div>


        <div>
            <div class="pull-right">

                {:getPagination($totalPageCount,10)}
            </div>
        </div>

    </div>

</div>
</div>
</block>

<block name="script">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <script type="text/javascript" src="__JS__/event.js"></script>
    <script>
        $(function () {
            $('#top_nav >li >a ').mouseenter(function () {
                $('.children_nav').hide();
                $('#children_' + $(this).attr('data')).show();
            });

            $('.event_sign').magnificPopup({
                type: 'ajax',
                overflowY: 'scroll',
                modal: true,
                callbacks: {
                    ajaxContentAdded: function () {
                        // Ajax content is loaded and appended to DOM

                        console.log(this.content);
                    }
                }
            });

        })


    </script>

    <script type="text/javascript">
        var SUPPORT_URL = "{:addons_url('Support://Support/doSupport')}";

    </script>
</block>










